| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkGraphics::TargetOperations Class Referenceabstract

Describes a target operation set. More...

Inheritance diagram for nkGraphics::TargetOperations:

## Public Member Functions
| TargetOperations (System *system) noexcept
| TargetOperations (const TargetOperations &)=delete
virtual | ~TargetOperations ()
nkMemory::StringView | getName () const
void | setName (nkMemory::StringView name)
virtual ClearTargetsPass * | addClearTargetsPass (unsigned int index=-1)
virtual ComputePass * | addComputePass (unsigned int index=-1)
virtual InstancingPass * | addInstancingPass (unsigned int index=-1)
virtual MonoMaterialPass * | addMonoMaterialPass (unsigned int index=-1)
virtual PostProcessPass * | addPostProcessPass (unsigned int index=-1)
virtual RaytracingPass * | addRaytracingPass (unsigned int index=-1)
virtual RenderScenePass * | addRenderScenePass (unsigned int index=-1)
unsigned int | getPassCount () const
Pass * | getPass (unsigned int index) const
virtual void | deletePass (unsigned int index)
virtual void | changePassOrder (unsigned int fromIndex, unsigned int toIndex)
virtual void | setColorTarget (const TargetDescriptor &targetDesc, unsigned int outputIndex=0)
virtual void | addColorTarget (const TargetDescriptor &targetDesc)
virtual void | changeColorTargetOrder (unsigned int fromIndex, unsigned int toIndex)
virtual void | removeColorTarget (unsigned int index)
virtual void | setDepthTarget (Texture *target)
unsigned int | getColorTargetCount () const
Texture * | getColorTarget (unsigned int index) const
int | getColorTargetRenderIndex (unsigned int index) const
Texture * | getDepthTarget () const
virtual void | setToBackBuffer (bool val, unsigned int indexInArray=0)
bool | isToBackBuffer () const
unsigned int | getBackBufferViewIndex () const
virtual void | setToChainDepthBuffer (bool val)
bool | isToChainDepthBuffer () const
virtual void | setOverloadedViewport (Viewport *value)
Viewport * | getOverloadedViewport () const
virtual void | execute ()=0
virtual void | exportClassToTree (nkExport::Node *rootNode) override
virtual void | importClassFromTree (nkExport::Node *rootNode) override
void | processColorTargetObjectNode (nkExport::Node *targetNode)
void | processPassObjectNode (nkExport::Node *passNode)
TargetOperations & | operator= (const TargetOperations &)=delete
Public Member Functions inherited from nkExport::Exportable
| Exportable () noexcept
virtual | ~Exportable ()

## Detailed Description

Describes a target operation set.

Its role is to specify where a rendering should happen. This implies setting any number of render target and the depth target. The passes are then executed sequentially to paint and use given targets.

## Constructor & Destructor Documentation

## ◆ TargetOperations() [1/2]

nkGraphics::TargetOperations::TargetOperations | ( | System * | system | ) |
| noexcept

Constructor. In theory, should not be called by external code. See CompositorNode::addOperations().

Parameters

  system | The system the resource should live in.

## ◆ TargetOperations() [2/2]

nkGraphics::TargetOperations::TargetOperations | ( | const TargetOperations & |  | ) |
| delete

Copy constructor.

## ◆ ~TargetOperations()

virtual nkGraphics::TargetOperations::~TargetOperations | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ getName()

nkMemory::StringView nkGraphics::TargetOperations::getName | ( |  | ) | const

Returns
  The name of the operation.

## ◆ setName()

void nkGraphics::TargetOperations::setName | ( | nkMemory::StringView | name | ) |

Sets the name of the operations.

Parameters

  name | The name to use for the operations.

## ◆ addClearTargetsPass()

virtual ClearTargetsPass* nkGraphics::TargetOperations::addClearTargetsPass | ( | unsigned int | index = `-1` | ) |
| virtual

Adds a clear targets pass to the operations.

Parameters

  index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass.

Returns
  The newly created pass. The TargetOperations owns the memory returned, external code should not delete it. See deletePass().

Remarks
  Passes are executed sequentially, the order in which they are added matters.

## ◆ addComputePass()

virtual ComputePass* nkGraphics::TargetOperations::addComputePass | ( | unsigned int | index = `-1` | ) |
| virtual

Adds a compute pass to the operations.

Parameters

  index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass.

Returns
  The newly created pass. The TargetOperations owns the memory returned, external code should not delete it. See deletePass().

Remarks
  Passes are executed sequentially, the order in which they are added matters.

## ◆ addInstancingPass()

virtual InstancingPass* nkGraphics::TargetOperations::addInstancingPass | ( | unsigned int | index = `-1` | ) |
| virtual

Adds an instancing pass to the operations.

Parameters

  index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass.

Returns
  The newly created pass. The TargetOperations owns the memory returned, external code should not delete it. See deletePass().

Remarks
  Passes are executed sequentially, the order in which they are added matters.

## ◆ addMonoMaterialPass()

virtual MonoMaterialPass* nkGraphics::TargetOperations::addMonoMaterialPass | ( | unsigned int | index = `-1` | ) |
| virtual

Adds a mono-material pass to the operations.

Parameters

  index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass.

Returns
  The newly created pass. The TargetOperations owns the memory returned, external code should not delete it. See deletePass().

Remarks
  Passes are executed sequentially, the order in which they are added matters.

## ◆ addPostProcessPass()

virtual PostProcessPass* nkGraphics::TargetOperations::addPostProcessPass | ( | unsigned int | index = `-1` | ) |
| virtual

Adds a post processing pass to the operations.

Parameters

  index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass.

Returns
  The newly created pass. The TargetOperations owns the memory returned, external code should not delete it. See deletePass().

Remarks
  Passes are executed sequentially, the order in which they are added matters.

## ◆ addRaytracingPass()

virtual RaytracingPass* nkGraphics::TargetOperations::addRaytracingPass | ( | unsigned int | index = `-1` | ) |
| virtual

Adds a raytracing pass to the operations.

Parameters

  index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass.

Returns
  The newly created pass. The TargetOperations owns the memory returned, external code should not delete it. See deletePass().

Remarks
  Passes are executed sequentially, the order in which they are added matters.

## ◆ addRenderScenePass()

virtual RenderScenePass* nkGraphics::TargetOperations::addRenderScenePass | ( | unsigned int | index = `-1` | ) |
| virtual

Adds a render scene pass to the operations.

Parameters

  index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass.

Returns
  The newly created pass. The TargetOperations owns the memory returned, external code should not delete it. See deletePass().

Remarks
  Passes are executed sequentially, the order in which they are added matters.

## ◆ getPassCount()

unsigned int nkGraphics::TargetOperations::getPassCount | ( |  | ) | const

Returns
  The number of active pass.

## ◆ getPass()

Pass* nkGraphics::TargetOperations::getPass | ( | unsigned int | index | ) | const

Parameters

  index | The index of the pass to retrieve.

Returns
  The pass linked to the index if available, nullptr else.

Remarks
  Due to usage of polymorphism, the base Pass class is returned. If need be, check Pass::getPassType().

## ◆ deletePass()

virtual void nkGraphics::TargetOperations::deletePass | ( | unsigned int | index | ) |
| virtual

Erases and frees the memory of a pass.

Parameters

  index | The index of the pass to erase.

## ◆ changePassOrder()

virtual void nkGraphics::TargetOperations::changePassOrder | ( | unsigned int | fromIndex,
|  | unsigned int | toIndex
| ) |  |
| virtual

Changes the ordering in the pass execution.

Parameters

  fromIndex | The index of the pass to move.
  toIndex | The index of the pass to swap with.

## ◆ setColorTarget()

virtual void nkGraphics::TargetOperations::setColorTarget | ( | const TargetDescriptor & | targetDesc,
|  | unsigned int | outputIndex = `0`
| ) |  |
| virtual

Sets a color target to a particular slot in the rendering array. It overrides any target previously set at given index. If the index is bigger than the target count, target just gets added as the last target.

Parameters

  targetDesc | The description of the target to render to.
  outputIndex | The index at which the target should be set.

## ◆ addColorTarget()

virtual void nkGraphics::TargetOperations::addColorTarget | ( | const TargetDescriptor & | targetDesc | ) |
| virtual

Adds a color target to the operations. Multi target is possible by adding multiple targets. The index associated in the output mergers will be given by the order in which targets are added, starting at 0.

Parameters

  targetDesc | The description of the target to render to.

## ◆ changeColorTargetOrder()

virtual void nkGraphics::TargetOperations::changeColorTargetOrder | ( | unsigned int | fromIndex,
|  | unsigned int | toIndex
| ) |  |
| virtual

Allows to change a target to make it attach to another slot.

Parameters

  fromIndex | The current index ot the target to move.
  toIndex | To which index it should be moved.

Remarks
  If a target is present at given toIndex, it is swapped with the one moving from fromIndex.

## ◆ removeColorTarget()

virtual void nkGraphics::TargetOperations::removeColorTarget | ( | unsigned int | index | ) |
| virtual

Parameters

  index | The index of the target to remove in the operations tracking memory.

## ◆ setDepthTarget()

virtual void nkGraphics::TargetOperations::setDepthTarget | ( | Texture * | target | ) |
| virtual

Parameters

  target | The depth target to use.

## ◆ getColorTargetCount()

unsigned int nkGraphics::TargetOperations::getColorTargetCount | ( |  | ) | const

Returns
  The number of color rendering target for the operations.

## ◆ getColorTarget()

Texture* nkGraphics::TargetOperations::getColorTarget | ( | unsigned int | index | ) | const

Parameters

  index | The index of the target to retrieve in the operations tracking memory.

Returns
  The render target attached to the index if available, nullptr else.

## ◆ getColorTargetRenderIndex()

int nkGraphics::TargetOperations::getColorTargetRenderIndex | ( | unsigned int | index | ) | const

Allows to retrieve the index of the render target view used for a render target at given index in tracking memory.

Parameters

  index | The index of the render target, in the operations memory.

Returns
  The used render target view's index from the render target if available, -1 else.

## ◆ getDepthTarget()

Texture* nkGraphics::TargetOperations::getDepthTarget | ( |  | ) | const

Returns
  The depth target written by the operations.

## ◆ setToBackBuffer()

virtual void nkGraphics::TargetOperations::setToBackBuffer | ( | bool | val,
|  | unsigned int | indexInArray = `0`
| ) |  |
| virtual

Enables the operations to render to the target provided by the context.

Parameters

  val | If the rendering should happen (true) or not (false).
  indexInArray | The index in which the back buffer should be written, if multi-target rendering is needed.

## ◆ isToBackBuffer()

bool nkGraphics::TargetOperations::isToBackBuffer | ( |  | ) | const

Returns
  If the operations is rendering to the context back buffer.

## ◆ getBackBufferViewIndex()

unsigned int nkGraphics::TargetOperations::getBackBufferViewIndex | ( |  | ) | const

Returns
  At which index the back buffer is being written in the operations, if enabled. This can serve during multi-target rendering.

## ◆ setToChainDepthBuffer()

virtual void nkGraphics::TargetOperations::setToChainDepthBuffer | ( | bool | val | ) |
| virtual

Sets if the operations should use the depth buffer provided by the context.

Parameters

  val | If the compositor's depth buffer should be used (true) or not (false).

## ◆ isToChainDepthBuffer()

bool nkGraphics::TargetOperations::isToChainDepthBuffer | ( |  | ) | const

Returns
  If the operations is rendering to the chain depth buffer (the one provided by the context).

## ◆ setOverloadedViewport()

virtual void nkGraphics::TargetOperations::setOverloadedViewport | ( | Viewport * | value | ) |
| virtual

Sets the viewport to use during the operations. By default, the viewport corresponds with the render targets dimensions. This function can be used to override this behaviour.

Parameters

  value | The viewport to use when executing.

## ◆ getOverloadedViewport()

Viewport* nkGraphics::TargetOperations::getOverloadedViewport | ( |  | ) | const

Returns
  The overloaded viewport for the operations.

## ◆ execute()

virtual void nkGraphics::TargetOperations::execute | ( |  | ) |
| pure virtual

Executes the operations and run all the passes. In theory, this function should not be called by external code, it is part of the rendering routine. See Compositor::renderChain().

## ◆ exportClassToTree()

virtual void nkGraphics::TargetOperations::exportClassToTree | ( | nkExport::Node * | rootNode | ) |
| override virtual

Basic exporting capabilities.

Parameters

  rootNode | The tree to export to.

Implements nkExport::Exportable.

## ◆ importClassFromTree()

virtual void nkGraphics::TargetOperations::importClassFromTree | ( | nkExport::Node * | rootNode | ) |
| override virtual

Basic importing capabilities.

Parameters

  rootNode | The tree to import from.

Implements nkExport::Exportable.

## ◆ processColorTargetObjectNode()

void nkGraphics::TargetOperations::processColorTargetObjectNode | ( | nkExport::Node * | targetNode | ) |

Utility function to process a target from its declaration. In theory, should not be called by external code. Used during import.

Parameters

  targetNode | The tree describing the render target.

## ◆ processPassObjectNode()

void nkGraphics::TargetOperations::processPassObjectNode | ( | nkExport::Node * | passNode | ) |

Utility function to process a pass from its declaration. In theory, should not be called by external code. Used during import.

Parameters

  passNode | The tree describing the pass.

## ◆ operator=()

TargetOperations& nkGraphics::TargetOperations::operator= | ( | const TargetOperations & |  | ) |
| delete

Copy assignment.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsGraphics/Compositors/TargetOperations.h